package com.sulent.frame.support.utils;

import lombok.extern.slf4j.Slf4j;

/**
 * @ClassName ProfilerUtil
 * @Description: 性能分析器工具类
 * @Author Submerge.
 * @Since 2025/3/17 10:53
 * @Version 1.0
 */
//@Slf4j
public class ProfilerUtil {

    private static final ThreadLocal<Long> PROFILER_THREAD = new ThreadLocal<Long>(){
        @Override
        protected Long initialValue() {
            return System.currentTimeMillis();
        }
    };

    private static void start(){
         PROFILER_THREAD.set(System.currentTimeMillis());
    }

    private static void end(){
        long cost = PROFILER_THREAD.get() - System.currentTimeMillis();
        System.out.println(Thread.currentThread().getName()+"执行耗时：" + cost);
    }


}
